import React from 'react';
    import { HashRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
    import Layout from './components/Layout';
    import HomePage from './pages/HomePage';
    import KnowledgeBasePage from './pages/KnowledgeBasePage';
    import CreateKnowledgeBasePage from './pages/CreateKnowledgeBasePage';
    import UploadDocumentPage from './pages/UploadDocumentPage';
    import EditDocumentPage from './pages/EditDocumentPage';
    import DocumentDetailPage from './pages/DocumentDetailPage';

    function App() {
      return (
        <Router>
          <Layout>
            <Routes>
              <Route path="/" element={<HomePage />} />
              <Route path="/create-kb" element={<CreateKnowledgeBasePage />} />
              <Route path="/kb/:kbId" element={<KnowledgeBasePage />} />
              <Route path="/kb/:kbId/upload" element={<UploadDocumentPage />} />
              <Route path="/kb/:kbId/doc/:docId" element={<DocumentDetailPage />} />
              <Route path="/kb/:kbId/doc/:docId/edit" element={<EditDocumentPage />} />
              <Route path="*" element={<Navigate to="/" replace />} />
            </Routes>
          </Layout>
        </Router>
      );
    }

    export default App;
